Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
Getting authentication error "Unable to find credentials in request" when I make a POST request in Cypress automation

I'm making a POST request in cypress automation but I keep getting an authentication error. The endpoint takes basic authetication.

  "error": "AuthenticationError",
  "text": "Unable to find credentials in request". 

Here is my request:
 
 cy.request({
                    url: 'TEST ENDPOINT',
                    method : 'POST',
                    auth: { 
                        username: 'test@test.com', 
                        password: 'test1'
                    }, 

                  body: {
                        
                        "firstname": "Bruce",
                        "lastname": "lee"
                 
                    });
 
          });

When I hit the same endpoint in POSTMAN it works as expected. Not sure what's wrong with my request.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There is no key called "auth", you should use either Header to pass your token or auth key in it.

method: 'POST',
    url: url,
    headers: {
        'content-type': 'application/json',
        'Accept': 'application/json',
        'Authorization':'Bearer '+token
    },
    body: JSON.stringify(body)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!